<html>
<head>
    <title>课表</title>
    <meta name="viewport" content="width=device-width" charset="utf-8">
    <style>
        *{
            padding: 0;
            margin: 0;}
    body{
        background: #fff;
        text-align: center;
        padding-top: 100px;
        font-size: 20px;
        line-height: 36px;
        font-family:幼圆;
    }
        .tip{
            position: absolute;
            top: 10px;
            width: 100%;
            font-size: 14px;
            color: #aaaaaa;
        }
        .content{
            width: 80%;
            margin:0 auto;
        }
    </style>
</head>
<body>
<div  id="content" class="content"></div>
<div class="tip">tip: 左右滑动以切换日期(仅支持移动端)</div>
</body>
<script>
    var obj=document.getElementById("content");
    var date=new Date(),week;
    var cns=new Array("天","一","二","三","四","五","六");
    var content="今天...星期...星期...星期...";
    show(0);
    touch();
    function touch() {
        document.addEventListener("touchstart",function () {
            start=event.targetTouches[0].pageX;
        });
        document.addEventListener("touchend",function () {
            end=event.changedTouches[0].pageX;
            x=end-start;
            window.console.log(x);
            /*判断滑动事件*/
            x<-40?show(1):x<40?window.console.log(0):show(-1);
        });
    }
    function show(e) {
        e==-1&&date.setDate(date.getDate()-1);
        e==1&&date.setDate(date.getDate()+1);
        week=date.getDay();
        switch (week){
            case 0:content="可能，会有，班会，看，群里，通知。";break;
            case 1:content="8:30 概率论 211<br>10:30 操作系统 314<br>14:00 javaWeb 实训楼304";break;
            case 2:content="8:30 概率论 222<br>10:30 数据结构 215<br>单周14:00 心理 301<br>" +
                "9-16单周14:00 职业指导 201<br>1-8单周晚上 创新创业 204";break;
            case 3:content="7:20 自习 307<br>8:30 软件工程课 213<br>10:30 面向对象UML 401";break;
            case 4:content="7:20 自习<br>8:30 数据结构 211<br>双周 14:00 操作系统 101";break;
            case 5:content="7:20 自习<br>8:30 面向对象UML 401 <br>14:00 javaWeb 311";break;
            case 6:content="应该，没课";break;
        }
        for(var i=0;i<7;i++){
            (week==i)&&(week=cns[i]);
        }
        obj.innerHTML=content;
        document.title="星期"+week;
    }
</script>
</html>